package cn.iocoder.yudao.boot.common.pojo;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public final class MyPage<T> implements Serializable {

    private Long page;

    private Long size;

    private List<T> list;

    private Long total;

    public MyPage() {
    }

    public MyPage(Long page, Long size) {
        this.page = page;
        this.size = size;
    }


    public MyPage(List<T> list, Long total) {
        this.list = list;
        this.total = total;
    }

    public MyPage(Long total) {
        this.list = new ArrayList<>();
        this.total = total;
    }

    public static <T> MyPage<T> empty() {
        return new MyPage<>(0L);
    }

    public static <T> MyPage<T> empty(Long total) {
        return new MyPage<>(total);
    }

}
